/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2010
 */

package com.osgix.authorize.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.osgix.common.pojo.BaseEntity;

public class UserRole extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;

	// alias
	public static final String TABLE_ALIAS = "UserRole";
	public static final String ALIAS_USER_ROLE_ID = "userRoleId";
	public static final String ALIAS_ROLE_ID = "roleId";
	public static final String ALIAS_USER_ID = "userId";

	// date formats

	// 可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	// columns START

	private Long userRoleId;

	private Long roleId;

	private Long userId;

	// columns END

	public UserRole() {
	}

	public UserRole(Long userRoleId) {
		this.userRoleId = userRoleId;
	}

	public void setUserRoleId(Long value) {
		this.userRoleId = value;
	}

	public Long getUserRoleId() {
		return this.userRoleId;
	}

	public void setRoleId(Long value) {
		this.roleId = value;
	}

	public Long getRoleId() {
		return this.roleId;
	}

	public void setUserId(Long value) {
		this.userId = value;
	}

	public Long getUserId() {
		return this.userId;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("UserRoleId", getUserRoleId())
				.append("RoleId", getRoleId()).append("UserId", getUserId()).toString();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(getUserRoleId()).toHashCode();
	}

	public boolean equals(Object obj) {
		if (obj instanceof UserRole == false)
			return false;
		if (this == obj)
			return true;
		UserRole other = (UserRole) obj;
		return new EqualsBuilder().append(getUserRoleId(), other.getUserRoleId()).isEquals();
	}
}
